package robot;

import com.google.wave.api.Image;

/**
 * Class Emoticon.
 * This class represents an Emoticon requested by the users.
 * @author Mirko Bonadei
 * @version 0.1
 *
 */
public class Emoticon implements Comparable<Object>{
	
	protected String code;
	protected Image image;
	
	/**
	 * Creates a new Emoticon.
	 * @param code String
	 * @param image Image
	 */
	public Emoticon(String code, Image image){
		this.code = code;
		this.image = image;
	}
	
	/**
	 * Returns the code that it is used by the user to request the 
	 * specified Emoticon.
	 * @return String
	 */
	public String getCode(){
		return this.code;
	}
	
	/**
	 * Returns the Image that represent the Emoticon requested by the user.
	 * @return Image
	 */
	public Image getImage(){
		return this.image;
	}

	@Override
	/**
	 * Compares 2 Emoticons.
	 * It is based on the compare between the 2 Emoticons Code.
	 */
	public int compareTo(Object arg0) {
		Emoticon tmp = (Emoticon) arg0;
		return this.getCode().compareTo(tmp.getCode());
	}

}
